package com.distribute.framework.model;

import com.distribute.framework.core.web.helper.Utils;
import java.lang.reflect.Field;
import java.util.Date; 
import java.util.Map;
import java.util.HashMap;
import java.util.List;
import java.util.ArrayList;

import javax.annotation.Resource;

import com.distribute.framework.core.web.util.Page;
import com.distribute.framework.core.lang.*; 
import com.distribute.framework.core.web.helper.WebHelper.LzMap;
import com.distribute.framework.core.util.Function;
import com.distribute.framework.core.util.IbatisMap;
import com.distribute.framework.config.*;
import com.distribute.framework.plugin.*;

@namespace("delivery/distributorcash")
public @caption("配送商提现") @database(DatabaseNames.distribute_sys) @source("distribute_sys") @table("distributor_cash") class DistributorCash implements java.io.Serializable
{
	private static final long serialVersionUID = 1l;
		
	
		
	private @caption("编号") @column("id")    @primary  @notnull  @note("  ") Long id;// 主键 非空     
			
 			
 			
 		
	
		
	private @caption("配送商") @column("distributor")   @hidden   @notnull  @relate("$distributor") @RelateClass(Distributor.class)  @note("  ") Long distributor;// 非空     
			
 	private transient Distributor $distributor;//关联对象[配送商信息]
 			
 			
 			
 		
	
		
	private transient @caption("配送商名称") @column("name") @like     @note("  ") String name;//     
			
 			
 			
 		
	
		
	private @caption("联系人") @column("contacts")     @notnull  @note("  ") String contacts;// 非空     
			
 			
 			
 		
	
		
	private @caption("手机号") @column("mobile")     @notnull  @note("  ") String mobile;// 非空     
			
 			
 			
 		
	
		
	private @caption("申请金额") @column("money")     @notnull  @note("  ") Double money;// 非空     
			
 			
 			
 		
	
		
	private @caption("支付宝名称") @column("alipay_name")     @notnull  @note("  ") String alipayName;// 非空     
			
 			
 			
 		
	
		
	private @caption("支付宝账号") @column("alipay_no")     @notnull  @note("  ") String alipayNo;// 非空     
			
 			
 			
 		
	
		
	private @caption("打款编号") @column("call_no")   @hidden    @note("  ") String callNo;//     
			
 			
 			
 		
	
		
	private @caption("打款状态") @column("approval_status")     @notnull  @note(" 1:审核中 2:已打款 3:拒绝  ") Short approvalStatus;// 非空 1:审核中 2:已打款 3:拒绝     
			
 			
 			
 		
	
		
	private @caption("日志") @column("erro_log")   @hidden    @note("  ") String erroLog;//     
			
 			
 			
 		
	
		
	private @caption("拒绝理由") @column("liyou") @like     @note("  ") String liyou;//     
			
 			
 			
 		
	
		
	private @caption("修改时间") @column("update_time")     @notnull  @note("  ") Date updateTime;// 非空     
			
 			
 			
 		
	
		
	private @caption("添加时间") @column("add_time")     @notnull  @note("  ") Date addTime;// 非空     
			
 			
 			
 		
	
		
	private @caption("状态") @column("status")     @notnull  @note(" 1:正常 0:无效  ") Short status;// 非空 1:正常 0:无效     
			
 			
 			
 		
	
	 
	//默认构造函数
	public DistributorCash(){ 
	
	}
	
	//主键构造函数
	public DistributorCash(Long id){
		this.id = id;
	}
	
	/**所有字段构造函数 
	 DistributorCash(
	 	Utils.getLong("")//配送商 [非空]
	 	,Utils.getString("")//联系人 [非空]
	 	,Utils.getString("")//手机号 [非空]
	 	,Utils.getDouble("")//申请金额 [非空]
	 	,Utils.getString("name")//支付宝名称 [非空]
	 	,Utils.getString("no")//支付宝账号 [非空]
	 	,Utils.getString("no")//打款编号
	 	,Utils.getShort("status")//打款状态 [非空]
	 	,Utils.getString("log")//日志
	 	,Utils.getString("")//拒绝理由
	 	,Utils.getDate("time")//修改时间 [非空]
	 	,Utils.getDate("time")//添加时间 [非空]
	 	,Utils.getShort("")//状态 [非空]
	 )
	**/
	public DistributorCash(Long distributor,String contacts,String mobile,Double money,String alipayName,String alipayNo,String callNo,Short approvalStatus,String erroLog,String liyou,Date updateTime,Date addTime,Short status){
		
			
			
		this.distributor=distributor;
		
			
			
		this.contacts=contacts;
		
			
		this.mobile=mobile;
		
			
		this.money=money;
		
			
		this.alipayName=alipayName;
		
			
		this.alipayNo=alipayNo;
		
			
		this.callNo=callNo;
		
			
		this.approvalStatus=approvalStatus;
		
			
		this.erroLog=erroLog;
		
			
		this.liyou=liyou;
		
			
		this.updateTime=updateTime;
		
			
		this.addTime=addTime;
		
			
		this.status=status;
		
	}
	
	//设置非空字段
	public DistributorCash setNotNull(Long distributor,String contacts,String mobile,Double money,String alipayName,String alipayNo,Short approvalStatus,Date updateTime,Date addTime,Short status){
		
			
			
		this.distributor=distributor;
		
			
			
		this.contacts=contacts;
		
			
		this.mobile=mobile;
		
			
		this.money=money;
		
			
		this.alipayName=alipayName;
		
			
		this.alipayNo=alipayNo;
		
			
			
		this.approvalStatus=approvalStatus;
		
			
			
			
		this.updateTime=updateTime;
		
			
		this.addTime=addTime;
		
			
		this.status=status;
		
		return this;
	}
	
	
		
	/** 编号 [非空]       **/
	public DistributorCash id(Long id){
		this.id = id;
		this.setSeted(F.id);
		return this;
	}
	
		
	/** 配送商 [非空] [Distributor]      **/
	public DistributorCash distributor(Long distributor){
		this.distributor = distributor;
		this.setSeted(F.distributor);
		return this;
	}
	
		
		
	/** 联系人 [非空]       **/
	public DistributorCash contacts(String contacts){
		this.contacts = contacts;
		this.setSeted(F.contacts);
		return this;
	}
	
		
	/** 手机号 [非空]       **/
	public DistributorCash mobile(String mobile){
		this.mobile = mobile;
		this.setSeted(F.mobile);
		return this;
	}
	
		
	/** 申请金额 [非空]       **/
	public DistributorCash money(Double money){
		this.money = money;
		this.setSeted(F.money);
		return this;
	}
	
		
	/** 支付宝名称 [非空]       **/
	public DistributorCash alipayName(String alipayName){
		this.alipayName = alipayName;
		this.setSeted(F.alipayName);
		return this;
	}
	
		
	/** 支付宝账号 [非空]       **/
	public DistributorCash alipayNo(String alipayNo){
		this.alipayNo = alipayNo;
		this.setSeted(F.alipayNo);
		return this;
	}
	
		
	/** 打款编号        **/
	public DistributorCash callNo(String callNo){
		this.callNo = callNo;
		this.setSeted(F.callNo);
		return this;
	}
	
		
	/** 打款状态 [非空]   1:审核中 2:已打款 3:拒绝     **/
	public DistributorCash approvalStatus(Short approvalStatus){
		this.approvalStatus = approvalStatus;
		this.setSeted(F.approvalStatus);
		return this;
	}
	
		
	/** 日志        **/
	public DistributorCash erroLog(String erroLog){
		this.erroLog = erroLog;
		this.setSeted(F.erroLog);
		return this;
	}
	
		
	/** 拒绝理由        **/
	public DistributorCash liyou(String liyou){
		this.liyou = liyou;
		this.setSeted(F.liyou);
		return this;
	}
	
		
	/** 修改时间 [非空]       **/
	public DistributorCash updateTime(Date updateTime){
		this.updateTime = updateTime;
		this.setSeted(F.updateTime);
		return this;
	}
	
		
	/** 添加时间 [非空]       **/
	public DistributorCash addTime(Date addTime){
		this.addTime = addTime;
		this.setSeted(F.addTime);
		return this;
	}
	
		
	/** 状态 [非空]   1:正常 0:无效     **/
	public DistributorCash status(Short status){
		this.status = status;
		this.setSeted(F.status);
		return this;
	}
	
	
	
	/**
	* 克隆对象
	**/
	public DistributorCash clone(){
		DistributorCash clone = new DistributorCash();
		
			
			
		clone.distributor=this.distributor;
		
			
			
		clone.contacts=this.contacts;
		
			
		clone.mobile=this.mobile;
		
			
		clone.money=this.money;
		
			
		clone.alipayName=this.alipayName;
		
			
		clone.alipayNo=this.alipayNo;
		
			
		clone.callNo=this.callNo;
		
			
		clone.approvalStatus=this.approvalStatus;
		
			
		clone.erroLog=this.erroLog;
		
			
		clone.liyou=this.liyou;
		
			
		clone.updateTime=this.updateTime;
		
			
		clone.addTime=this.addTime;
		
			
		clone.status=this.status;
		
		return clone;
	}
	
	
	
	
	
	/**
	 * 根据ID取配送商提现
	 * @param id
	 * @return
	 */
	public static @api DistributorCash get(Long id){		
		return getDistributorCashById(id);
	}
	
	
	
	/**
	 * 获取所有配送商提现
	 * @return
	 */
	public static @api List<DistributorCash> list(Map params,Integer size){
		return getDistributorCashList(params,size);
	}
	/**
	 * 获取配送商提现分页
	 * @return
	 */
	public static @api Page<DistributorCash> page(Integer page,Integer size,Map params){
		return getDistributorCashPage(page, size , params);
	}
	
	
	/**
	 * 根据查询条件取配送商提现
	 * @param params
	 * @return
	 */
	public static @api DistributorCash Get(Map params){
		return getDistributorCash(params);
	}
	/**
	 * 获取配送商提现数
	 * @return
	 */
	public static @api Long count(Map params){
		return getDistributorCashCount(params);
	}
	/**
	 * 获取配送商提现数
	 * @return
	 */
	public static @api <T> T eval(String eval,Map params){
		return getDistributorCashEval(eval,params);
	}
	
	
	/**
	 * 获取配送商提现图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> stats(Map params,C sumKey,C groupKey){
		return getDistributorCashStats(params,sumKey,groupKey,-1);
	}
	/**
	 * 获取配送商提现图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 分组的字段
	 * @param dateType 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> stats(Map params,C sumKey,C groupKey,int dateType){
		return getDistributorCashStats(params,sumKey,groupKey,dateType);
	}
	
	
	/**
	 * 根据ID取配送商提现
	 * @param id
	 * @return
	 */
	public static @api DistributorCash getDistributorCashById(Long id){		
		return getDistributorCashDao().getDistributorCashById(id);
	}
	
	
	
	
	/**
	 * 根据ID取配送商提现的标识键值
	 * @param id
	 * @return
	 */
	public static @api String getKeyValue(Object key){
		Long id = Utils.parseLong(key);	
		if(id==null || id.longValue()==0 ){
			
			return null;
			
		}
		String value = null;
				
		if(value==null){
			DistributorCash distributorCash = get(id);
			if(distributorCash!=null){
				String strValue = distributorCash.getId$();
				
				
				value = strValue;
			}else{
				
				value = "{"+id+"}";
			}
		}
		
		/************LAZY3Q_ID_KEYVALUE************/
		/************LAZY3Q_ID_KEYVALUE************/
		return value;
	}	
	
	
	/**
	 * 获取当前对象的键值
	 * @return
	 */
	public String getKeyValue(){
		
		/************LAZY3Q_CODE_KEYVALUE************/
		/************LAZY3Q_CODE_KEYVALUE************/
		String keyValue = this.getId$();
		
		return keyValue;
	}
	
	
	/**
	 * 根据关键字精确查询配送商提现对象
	 * @return
	 */
	public static @api DistributorCash find(String key){
		if(Utils.empty(key))return null;
		Map params = new HashMap();
		if(key.toLowerCase().startsWith("id:"))//如果查询条件以id:开头，则按ID查询
			params.put("id", key.toLowerCase().replaceFirst("id:", ""));					
		else{//按标识查询，精确查询
			String strDefinex = "";
			
			strDefinex="(2=1 "+strDefinex+")";
			params.put("definex",strDefinex);
		}
		
		/************LAZY3Q_CODE_FIND************/
		/************LAZY3Q_CODE_FIND************/
		return DistributorCash.getDistributorCash(params);
	}
	
	
	/**
	 * 根据关键字查询配送商提现
	 * @return
	 */
	public static @api List<Map> query(String key,int size,Map params,Boolean bObject){
		if(Utils.empty((String)params.get("asc")) && Utils.empty((String)params.get("desc")))//如果未传入排序字段
			params.put("desc","id");//那么，默认以主键降序，传给Dao层
		String strTerm=key;		
		if(!Utils.empty(strTerm)){
			if(strTerm.toLowerCase().startsWith("id:"))//如果查询条件以id:开头，则按ID查询
				params.put("id", strTerm.toLowerCase().replaceFirst("id:", ""));					
			else//按标识查询，模糊查询请带%
			{
				String strDefinex = "";
				
				strDefinex="(2=1 "+strDefinex+")";
				params.put("definex",strDefinex);
			}
		}
		
		
		/************LAZY3Q_CODE_QUERY************/
		/************LAZY3Q_CODE_QUERY************/
			
		List<DistributorCash> list = page(0,size,params).getResult();
		
		/**
		* OK!取到数据拼成放入Map中，[{value,text,object:{...}},...]
		* value:数据ID，text:数据标识,object,整个对象
		**/
		List<Map> result = new java.util.ArrayList();
		for(DistributorCash distributorCash:list){
			Map map = new HashMap();
			map.put("key",distributorCash.getId().toString());
			map.put("value", Utils.js(distributorCash.getKeyValue()));
			if(bObject==true)
				map.put("object",distributorCash);
			result.add(map);
		}
		
		
		/************LAZY3Q_AFTER_QUERY************/
		/************LAZY3Q_AFTER_QUERY************/
		
		return result;
	}
	
	
	
	/**
	 * 获取所有配送商提现
	 * @return
	 */
	public static @api List<DistributorCash> getDistributorCashList(Map params,Integer size){
		return getDistributorCashDao().getDistributorCashList(params,0,size);
	}
	
	/**
	 * 获取配送商提现分页
	 * @return
	 */
	public static @api Page<DistributorCash> getDistributorCashPage(Integer page,Integer size,Map params){
		if(page==null)page=0;
		if(size==null)size=20;
		return getDistributorCashDao().getDistributorCashPage(page, size , params);
	}
	
	/**
	 * 根据查询条件取配送商提现
	 * @param params
	 * @return
	 */
	public static @api DistributorCash getDistributorCash(Map params){
		return getDistributorCashDao().getDistributorCash(params);
	}
	
	/**
	 * 保存一个配送商提现
	 * @param distributorCash
	 * @return
	 */
	public static @api DistributorCash saveDistributorCash(DistributorCash distributorCash){
		return getDistributorCashDao().saveDistributorCash(distributorCash);
	}
	
	/**
	 * 根据条件更新配送商提现
	 * @param values
	 * @param params
	 */
	public static @api int updateDistributorCashByConfirm(Map values, Map params){
		return getDistributorCashDao().updateDistributorCashByConfirm(values,params);
	}
	
	/**
	 * 修改一个配送商提现
	 * @param distributorCash
	 * @return
	 */
	public static @api int updateDistributorCash(DistributorCash distributorCash){
		return getDistributorCashDao().updateDistributorCash(distributorCash);
	}
	
	/**
	 * 更新配送商提现非空字段
	 * @param distributorCash
	 */
	public static @api int updateDistributorCash$NotNull(DistributorCash distributorCash){
		return getDistributorCashDao().updateDistributorCash$NotNull(distributorCash);
	}
	
	/**
	 * 获取配送商提现数
	 * @return
	 */
	public static @api Long getDistributorCashCount(Map params){
		return getDistributorCashDao().getDistributorCashCount(params);
	}
		
		
	/**
	 * 获取配送商提现自定义求和表达式,比如求和:eval="sum(id)"
	 * @return
	 */	
	public static @api <T> T getDistributorCashEval(String eval,Map params){
		return getDistributorCashDao().getDistributorCashEval(eval,params);
	}
	
	
	/**
	 * 获取配送商提现图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 分组的字段
	 * @param dateType 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> getDistributorCashStats(Map params,C sumKey,C groupKey,int dateType){
		//TODO:图表统计功能未实现
		
		Map<String,Object> groups=new HashMap();//要分组的字段
		Map<String,Object> sums=new HashMap();//要统计的字段
		
		String[][] dateFormats=new String[][]{
				null,
				new String[]{"%Y","yyyy年","Y"},
				new String[]{"%Y-%m","yyyy年MM月","M"},
				new String[]{"%Y%U","yyyy年第ww周","W"},
				new String[]{"%Y-%m-%d","yyyy年MM月dd日","D"},
				new String[]{"%Y-%m-%d %H","yyyy年MM月dd日 HH点","H"},
				new String[]{"%m","MM月"},
				new String[]{"%d","dd号"},
				new String[]{"%H","HH点"} 
		};
		
		//获取要分组的字段，放入Map中
		if(dateType>0){
			groups.put(groupKey.toString(),"DATE_FORMAT({key},'"+dateFormats[dateType][0]+"')");
		}else{
			groups.put(groupKey.toString(),"{key}");
		}
		if(dateType<6 && dateType>0){ 
			params.put("asc", groupKey.toString()); 
			if(params.get(groupKey.name()+"Start")==null){
				params.put(groupKey.name()+"Start", Utils.date(new Date(), -24, dateFormats[dateType][2]));
			}
		}
		
		
		//获取要统计的字段，放入Map中
		if(sumKey.toString().equals("count")){
			sums.put(sumKey.toString(),"count(*)");
		}else{
			sums.put(sumKey.toString(),"sum({key})");
		}
		
		List<Map> list = getDistributorCashDao().getDistributorCashStats(params,groups,sums);
		
		List<Map> result = new ArrayList();
		for(Map m:list){
			Map map = new HashMap();
			Object value = m.get(sumKey.toString());
			Object name = null;
			Object groupValue = m.get(groupKey.toString());
			if(dateType>0){
				name = Utils.date(Utils.parseDate(groupValue), dateFormats[dateType][1]);
			}else{
				try{
					java.lang.reflect.Method method = DistributorCash.class.getMethod("get"+Utils.ForMat(groupKey.toString())+"$");
					method.setAccessible(true);
					name = method.invoke(DistributorCash.fromMap(m));
				}catch(Exception ex){
					ex.printStackTrace();
				}
			}
			map.put("name", name);
			map.put("value", value);
			result.add(map);
		}
		return result;
	}
	
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static int updateDistributorCash(Map set,Map where){
		if(set.isEmpty())throw new RuntimeException("set为空");
		if(where.isEmpty())throw new RuntimeException("where为空");
		where.put("confirm", "1");
		return getDistributorCashDao().updateDistributorCashByConfirm(set, where);
	}
	
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static void deleteDistributorCash(Map where){
		if(where.isEmpty())throw new RuntimeException("where为空");
		where.put("confirm", "1");
		getDistributorCashDao().deleteDistributorCashByConfirm(where);
	}
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static void delete(Long id){
		if(id==null)throw new RuntimeException("id为空");
		
		getDistributorCashDao().removeDistributorCashById(id);
		
	}
	
	
	/**
	 * 保存配送商提现对象
	 * @param params
	 * @return
	 */
	public DistributorCash save(){
		if(this.getId()!=null)
			getDistributorCashDao().updateDistributorCash(this);
		else
			return getDistributorCashDao().saveDistributorCash(this);
		return this;
	}
	
	
	/**
	 * 更新配送商提现对象的非空字段,注意跟Service里面的update不一样哦
	 * @param params
	 * @return
	 */
	public int update(){
		return getDistributorCashDao().updateDistributorCash$NotNull(this);
	}
	
	
	/**
	 * 删除
	 * @param params
	 * @return
	 */
	public void delete(){
		
		if(Utils.equals(Utils.config("logic_delete"),"true"))
			getDistributorCashDao().removeDistributorCashById(this.getId());
		else
		
			getDistributorCashDao().deleteDistributorCashById(this.getId());
	}
	
	/**
	 * 执行事务
	 * @param function
	 */
	public static <T> T execute(Function function){
		return getDistributorCashDao().executeTransaction(function);
	}

	
	
	/*******************************编号**********************************/	
	/**
	* 编号 [非空]      
	**/
	public Long getId(){
		
		if(this.id!=null){
			return this.id;
		}
		
		return this.id;
	}
	/**
	* 获取编号格式化(toString)
	**/
	public String getId$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getId());
	 
	 	 return strValue;
	}
	/**
	* 根据编号反格式化
	**/
	public void setId$(String strValue){
		if(Utils.empty(strValue)){
			this.id=null;
			return;
		}
	
	
	 	this.id=Utils.parseLong(strValue);
	 
	}
	
	/**
	* 编号 [非空]      
	**/
	public void setId(Long id){
		this.id = id;
		
		this.setSeted(F.id);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************配送商**********************************/	
	/**
	* 配送商 [非空] [Distributor]     
	**/
	public Long getDistributor(){
		
		if(this.distributor!=null){
			return this.distributor;
		}
		
		return this.distributor;
	}
	/**
	* 获取配送商格式化(toString)
	**/
	public String getDistributor$(){
		String strValue="";
	
	
		 
		if(this.getDistributor()!=null){
			
				strValue+=Utils.string(Distributor.getKeyValue(this.getDistributor()));
			
		}			
		 
	 
	 	 return strValue;
	}
	/**
	* 根据配送商反格式化
	**/
	public void setDistributor$(String strValue){
		if(Utils.empty(strValue)){
			this.distributor=null;
			return;
		}
	
	
		 
		Distributor item = Distributor.find(strValue);
		if(item!=null){
			
			this.distributor = Utils.parseLong(item.getId());
			
		}
		 
	 
	}
	
	/**
	* 配送商 [非空] [Distributor]     
	**/
	public void setDistributor(Long distributor){
		this.distributor = distributor;
		
		this.setSeted(F.distributor);
		
	}
	
	
		 
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 		
	/**
	* 获取关联对象[配送商信息]
	**/	 			
 	public Distributor get$distributor(){
 		if(this.$distributor!=null)
 			return this.$distributor;
 		com.distribute.framework.model.Distributor distributor = null;
		if(this.getDistributor()!=null){
		
 			distributor = Distributor.get(this.getDistributor());
 		
 		}
 		return distributor;
	}
	
 	
	
	
	/*******************************配送商名称**********************************/	
	/**
	* 配送商名称       
	**/
	public String getName(){
		
		if(this.name!=null){
			return this.name;
		}
		
		Distributor distributor = Distributor.get(this.getDistributor());
		if(distributor!=null){
			this.name=distributor.getName();
		}
				
		
		return this.name;
	}
	/**
	* 获取配送商名称格式化(toString)
	**/
	public String getName$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getName());
	 
	 	 return strValue;
	}
	/**
	* 根据配送商名称反格式化
	**/
	public void setName$(String strValue){
		if(Utils.empty(strValue)){
			this.name=null;
			return;
		}
	
	
	 	this.name=strValue;
	 
	}
	
	/**
	* 配送商名称       
	**/
	public void setName(String name){
		this.name = name;
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************联系人**********************************/	
	/**
	* 联系人 [非空]      
	**/
	public String getContacts(){
		
		if(this.contacts!=null){
			return this.contacts;
		}
		
		return this.contacts;
	}
	/**
	* 获取联系人格式化(toString)
	**/
	public String getContacts$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getContacts());
	 
	 	 return strValue;
	}
	/**
	* 根据联系人反格式化
	**/
	public void setContacts$(String strValue){
		if(Utils.empty(strValue)){
			this.contacts=null;
			return;
		}
	
	
	 	this.contacts=strValue;
	 
	}
	
	/**
	* 联系人 [非空]      
	**/
	public void setContacts(String contacts){
		this.contacts = contacts;
		
		this.setSeted(F.contacts);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************手机号**********************************/	
	/**
	* 手机号 [非空]      
	**/
	public String getMobile(){
		
		if(this.mobile!=null){
			return this.mobile;
		}
		
		return this.mobile;
	}
	/**
	* 获取手机号格式化(toString)
	**/
	public String getMobile$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getMobile());
	 
	 	 return strValue;
	}
	/**
	* 根据手机号反格式化
	**/
	public void setMobile$(String strValue){
		if(Utils.empty(strValue)){
			this.mobile=null;
			return;
		}
	
	
	 	this.mobile=strValue;
	 
	}
	
	/**
	* 手机号 [非空]      
	**/
	public void setMobile(String mobile){
		this.mobile = mobile;
		
		this.setSeted(F.mobile);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************申请金额**********************************/	
	/**
	* 申请金额 [非空]      
	**/
	public Double getMoney(){
		
		if(this.money!=null){
			return this.money;
		}
		
		return this.money;
	}
	/**
	* 获取申请金额格式化(toString)
	**/
	public String getMoney$(){
		String strValue="";
	
	
			
		 strValue=Utils.string(this.getMoney());	
			
	 
	 	 return strValue;
	}
	/**
	* 根据申请金额反格式化
	**/
	public void setMoney$(String strValue){
		if(Utils.empty(strValue)){
			this.money=null;
			return;
		}
	
	
	 	this.money=Utils.parseDouble(strValue);
	 
	}
	
	/**
	* 申请金额 [非空]      
	**/
	public void setMoney(Double money){
		this.money = money;
		
		this.setSeted(F.money);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************支付宝名称**********************************/	
	/**
	* 支付宝名称 [非空]      
	**/
	public String getAlipayName(){
		
		if(this.alipayName!=null){
			return this.alipayName;
		}
		
		return this.alipayName;
	}
	/**
	* 获取支付宝名称格式化(toString)
	**/
	public String getAlipayName$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getAlipayName());
	 
	 	 return strValue;
	}
	/**
	* 根据支付宝名称反格式化
	**/
	public void setAlipayName$(String strValue){
		if(Utils.empty(strValue)){
			this.alipayName=null;
			return;
		}
	
	
	 	this.alipayName=strValue;
	 
	}
	
	/**
	* 支付宝名称 [非空]      
	**/
	public void setAlipayName(String alipayName){
		this.alipayName = alipayName;
		
		this.setSeted(F.alipayName);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************支付宝账号**********************************/	
	/**
	* 支付宝账号 [非空]      
	**/
	public String getAlipayNo(){
		
		if(this.alipayNo!=null){
			return this.alipayNo;
		}
		
		return this.alipayNo;
	}
	/**
	* 获取支付宝账号格式化(toString)
	**/
	public String getAlipayNo$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getAlipayNo());
	 
	 	 return strValue;
	}
	/**
	* 根据支付宝账号反格式化
	**/
	public void setAlipayNo$(String strValue){
		if(Utils.empty(strValue)){
			this.alipayNo=null;
			return;
		}
	
	
	 	this.alipayNo=strValue;
	 
	}
	
	/**
	* 支付宝账号 [非空]      
	**/
	public void setAlipayNo(String alipayNo){
		this.alipayNo = alipayNo;
		
		this.setSeted(F.alipayNo);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************打款编号**********************************/	
	/**
	* 打款编号       
	**/
	public String getCallNo(){
		
		if(this.callNo!=null){
			return this.callNo;
		}
		
		return this.callNo;
	}
	/**
	* 获取打款编号格式化(toString)
	**/
	public String getCallNo$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getCallNo());
	 
	 	 return strValue;
	}
	/**
	* 根据打款编号反格式化
	**/
	public void setCallNo$(String strValue){
		if(Utils.empty(strValue)){
			this.callNo=null;
			return;
		}
	
	
	 	this.callNo=strValue;
	 
	}
	
	/**
	* 打款编号       
	**/
	public void setCallNo(String callNo){
		this.callNo = callNo;
		
		this.setSeted(F.callNo);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************打款状态**********************************/	
	/**
	* 打款状态 [非空]   1:审核中 2:已打款 3:拒绝    
	**/
	public Short getApprovalStatus(){
		
		if(this.approvalStatus!=null){
			return this.approvalStatus;
		}
		
		return this.approvalStatus;
	}
	/**
	* 获取打款状态格式化(toString)
	**/
	public String getApprovalStatus$(){
		String strValue="";
	
	
		
			
		 if(Utils.equals(Utils.string(this.getApprovalStatus()),"1"))
			strValue=Utils.string("审核中");		 
			
		 if(Utils.equals(Utils.string(this.getApprovalStatus()),"2"))
			strValue=Utils.string("已打款");		 
			
		 if(Utils.equals(Utils.string(this.getApprovalStatus()),"3"))
			strValue=Utils.string("拒绝");		 
			
		
	 
	 	 return strValue;
	}
	/**
	* 根据打款状态反格式化
	**/
	public void setApprovalStatus$(String strValue){
		if(Utils.empty(strValue)){
			this.approvalStatus=null;
			return;
		}
	
	
		
			
		 if(Utils.equals(strValue,"审核中"))
		 	this.approvalStatus=Utils.parseShort("1");
			
		 if(Utils.equals(strValue,"已打款"))
		 	this.approvalStatus=Utils.parseShort("2");
			
		 if(Utils.equals(strValue,"拒绝"))
		 	this.approvalStatus=Utils.parseShort("3");
			
		
	 
	}
	
	/**
	* 打款状态 [非空]   1:审核中 2:已打款 3:拒绝    
	**/
	public void setApprovalStatus(Short approvalStatus){
		this.approvalStatus = approvalStatus;
		
		this.setSeted(F.approvalStatus);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************日志**********************************/	
	/**
	* 日志       
	**/
	public String getErroLog(){
		
		if(this.erroLog!=null){
			return this.erroLog;
		}
		
		return this.erroLog;
	}
	/**
	* 获取日志格式化(toString)
	**/
	public String getErroLog$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getErroLog());
	 
	 	 return strValue;
	}
	/**
	* 根据日志反格式化
	**/
	public void setErroLog$(String strValue){
		if(Utils.empty(strValue)){
			this.erroLog=null;
			return;
		}
	
	
	 	this.erroLog=strValue;
	 
	}
	
	/**
	* 日志       
	**/
	public void setErroLog(String erroLog){
		this.erroLog = erroLog;
		
		this.setSeted(F.erroLog);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************拒绝理由**********************************/	
	/**
	* 拒绝理由       
	**/
	public String getLiyou(){
		
		if(this.liyou!=null){
			return this.liyou;
		}
		
		return this.liyou;
	}
	/**
	* 获取拒绝理由格式化(toString)
	**/
	public String getLiyou$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getLiyou());
	 
	 	 return strValue;
	}
	/**
	* 根据拒绝理由反格式化
	**/
	public void setLiyou$(String strValue){
		if(Utils.empty(strValue)){
			this.liyou=null;
			return;
		}
	
	
		this.liyou=strValue;
	 
	}
	
	/**
	* 拒绝理由       
	**/
	public void setLiyou(String liyou){
		this.liyou = liyou;
		
		this.setSeted(F.liyou);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************修改时间**********************************/	
	/**
	* 修改时间 [非空]      
	**/
	public Date getUpdateTime(){
		
		if(this.updateTime!=null){
			return this.updateTime;
		}
		
		return this.updateTime;
	}
	/**
	* 获取修改时间格式化(toString)
	**/
	public String getUpdateTime$(){
		String strValue="";
	
	
	 	
		 strValue=Utils.string(Utils.date(this.getUpdateTime(),"yyyy-MM-dd HH:mm:ss"));
		
	 
	 	 return strValue;
	}
	/**
	* 根据修改时间反格式化
	**/
	public void setUpdateTime$(String strValue){
		if(Utils.empty(strValue)){
			this.updateTime=null;
			return;
		}
	
	
	 	this.updateTime=Utils.date(strValue,"yyyy-MM-dd HH:mm:ss");
	 
	}
	
	/**
	* 修改时间 [非空]      
	**/
	public void setUpdateTime(Date updateTime){
		this.updateTime = updateTime;
		
		this.setSeted(F.updateTime);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************添加时间**********************************/	
	/**
	* 添加时间 [非空]      
	**/
	public Date getAddTime(){
		
		if(this.addTime!=null){
			return this.addTime;
		}
		
		return this.addTime;
	}
	/**
	* 获取添加时间格式化(toString)
	**/
	public String getAddTime$(){
		String strValue="";
	
	
	 	
		 strValue=Utils.string(Utils.date(this.getAddTime(),"yyyy-MM-dd HH:mm:ss"));
		
	 
	 	 return strValue;
	}
	/**
	* 根据添加时间反格式化
	**/
	public void setAddTime$(String strValue){
		if(Utils.empty(strValue)){
			this.addTime=null;
			return;
		}
	
	
	 	this.addTime=Utils.date(strValue,"yyyy-MM-dd HH:mm:ss");
	 
	}
	
	/**
	* 添加时间 [非空]      
	**/
	public void setAddTime(Date addTime){
		this.addTime = addTime;
		
		this.setSeted(F.addTime);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************状态**********************************/	
	/**
	* 状态 [非空]   1:正常 0:无效    
	**/
	public Short getStatus(){
		
		if(this.status!=null){
			return this.status;
		}
		
		return this.status;
	}
	/**
	* 获取状态格式化(toString)
	**/
	public String getStatus$(){
		String strValue="";
	
	
		
			
		 if(Utils.equals(Utils.string(this.getStatus()),"1"))
			strValue=Utils.string("正常");		 
			
		 if(Utils.equals(Utils.string(this.getStatus()),"0"))
			strValue=Utils.string("无效");		 
			
		
	 
	 	 return strValue;
	}
	/**
	* 根据状态反格式化
	**/
	public void setStatus$(String strValue){
		if(Utils.empty(strValue)){
			this.status=null;
			return;
		}
	
	
		
			
		 if(Utils.equals(strValue,"正常"))
		 	this.status=Utils.parseShort("1");
			
		 if(Utils.equals(strValue,"无效"))
		 	this.status=Utils.parseShort("0");
			
		
	 
	}
	
	/**
	* 状态 [非空]   1:正常 0:无效    
	**/
	public void setStatus(Short status){
		this.status = status;
		
		this.setSeted(F.status);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	
	/************LAZY3Q_DEFINE_CODE************/
	/************LAZY3Q_DEFINE_CODE************/	
	
	
	/**
	 * 触发器
	 */
	public static void on(Trigger.Index index,final Notify.Listener listener,Trigger.Type... types){
		Notify.on(DistributorCash.class, index, listener, types);
	}
	public static void on(final Notify.Listener listener,String type){
		Notify.on(DistributorCash.class, listener, type);
	}
	/**
	 * 当修改字段时
	 * @param filedName
	 * @param listener
	 */
	public static void on(String filedName,final Notify.Listener listener){
		Notify.on(DistributorCash.class, listener, filedName);
	}
	/**
	 * 当修改字段为某值时
	 * @param filedName
	 * @param value
	 * @param listener
	 */
	public static void on(String filedName,Object value,final Notify.Listener listener){
		if(value==null)return;
		Notify.on(DistributorCash.class, listener, filedName+"."+Utils.md5(""+value));
	}
	public void notify(String type){
		Trigger.on(DistributorCash.class,type, this);
	}
	
	
	/**
	 * 用来获取当有字段关联对象时的获取方式,调用如${DistributorCash.obj.filedName}
	 * 因为有些变态的模板语言不能识别$，所以不能以${DistributorCash.$filedName}获取关联对象
	 */
	public Map getObj(){
		return new HashMap(){
			@Override
			public Object get(Object key) {
				try {
					return DistributorCash.class.getMethod("get$"+Utils.forMat(key.toString())).invoke(DistributorCash.this);
				} catch (Exception e) {
					e.printStackTrace();
				}
				return null;
			}
		};
	}
	/**
	 * 用来获取某字段格式化的获取方式,调用如${DistributorCash.fmt.filedName}
	 * 因为有些变态的模板语言不能识别$，所以不能以${DistributorCash.filedName$}获取某字段格式化
	 */
	public Map getFmt(){
		return new HashMap(){
			@Override
			public Object get(Object key) {
				try {
					return DistributorCash.class.getMethod("get"+Utils.ForMat(key.toString()+"$")).invoke(DistributorCash.this);
				} catch (Exception e) {
					e.printStackTrace();
				}
				return null;
			}
		};
	}
	/**
	 * 获取查询参数链式串
	 * @return
	 */
	public static @Deprecated M where(){ return new M(0); }
	public static @Deprecated M m(){ return new M(0); }
	public static M where = new M(0,true);
	public static @database(DatabaseNames.distribute_sys) class M extends IbatisMap{
		int type = 0; 
		M linked = null;
		Boolean proxy = false;
		public M set = null;
		public M(int type){
			this.type = type;
			if(this.type==0){
				set = new M(1,true);
				set.linked = this;
			}
		};
		public M(int type,Boolean proxy){
			this.type = type;
			this.proxy=proxy;
		};
		public M proxy(){
			M m = new M(this.type);//当前的对像
			if(this.type==0){
				m.set = new M(1,true);//set对象
				m.set.linked = m;
			}else{
				m.linked=this.linked;
				this.linked.linked=m;
			}
			return m;
		}
		public @Deprecated M set(){			
			M m = this;
			m.linked=new M(1);
			m.linked.linked=m;
			return m.linked;
		};
		
		public M on(IbatisMap value,C column,String joinColumn){if(proxy)return proxy().on(value,column,joinColumn);this.put(value.getClass().getDeclaringClass().getSimpleName(), value);value.put("on", column.toString());value.put("to", joinColumn);return this;};
		
		
			
		
		/** 编号 [非空]       **/
		public M id(Object id){if(proxy)return proxy().id(id);  this.put("id", id);return this;};
	 	/** and id is null */
 		public M idNull(){if(proxy)return proxy().idNull();if(this.get("idNot")==null)this.put("idNot", "");this.put("id", null);return this;};
 		/** not .... */
 		public M idNot(){if(proxy)return proxy().idNot();this.put("idNot", "not");return this;};
 		public M idNotNull(){if(proxy)return proxy().idNotNull();this.put("idNot", "not");this.put("id", null);return this;};
 		public M idNot(Object id){if(proxy)return proxy().idNot(id);this.put("idNot", "not");this.put("id", id);return this;};
	 		
		/** and id <= ? */
		public M idMin(Object min){if(proxy)return proxy().idMin(min);this.put("idMin", min);return this;};
		/** and id >= ? */
		public M idMax(Object max){if(proxy)return proxy().idMax(max);this.put("idMax", max);return this;};
			
			
		public M idIn(String ids){
			if(proxy)return proxy().idIn(ids);  this.put("idIn", ids);return this;
		};	
 			
		
			
	 	
			
		public M distributor$on(Distributor.M value){if(proxy)return proxy().distributor$on(value);this.put("Distributor", value);value.put("on", "distributor");return this;};
 				
 			
		
		/** 配送商 [非空] [Distributor]      **/
		public M distributor(Object distributor){if(proxy)return proxy().distributor(distributor);  this.put("distributor", distributor);return this;};
	 	/** and distributor is null */
 		public M distributorNull(){if(proxy)return proxy().distributorNull();if(this.get("distributorNot")==null)this.put("distributorNot", "");this.put("distributor", null);return this;};
 		/** not .... */
 		public M distributorNot(){if(proxy)return proxy().distributorNot();this.put("distributorNot", "not");return this;};
 		public M distributorNotNull(){if(proxy)return proxy().distributorNotNull();this.put("distributorNot", "not");this.put("distributor", null);return this;};
 		public M distributorNot(Object distributor){if(proxy)return proxy().distributorNot(distributor);this.put("distributorNot", "not");this.put("distributor", distributor);return this;};
	 		
			
		public M distributorIn(String ids){
			if(proxy)return proxy().distributorIn(ids);  this.put("distributorIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 配送商名称        **/
		public M name(Object name){if(proxy)return proxy().name(name);  this.put("name", name);return this;};
	 	/** and name is null */
 		public M nameNull(){if(proxy)return proxy().nameNull();if(this.get("nameNot")==null)this.put("nameNot", "");this.put("name", null);return this;};
 		/** not .... */
 		public M nameNot(){if(proxy)return proxy().nameNot();this.put("nameNot", "not");return this;};
 		public M nameNotNull(){if(proxy)return proxy().nameNotNull();this.put("nameNot", "not");this.put("name", null);return this;};
 		public M nameNot(Object name){if(proxy)return proxy().nameNot(name);this.put("nameNot", "not");this.put("name", name);return this;};
	 		
			
		
			
	 	
			
		
		/** 联系人 [非空]       **/
		public M contacts(Object contacts){if(proxy)return proxy().contacts(contacts);  this.put("contacts", contacts);return this;};
	 	/** and contacts is null */
 		public M contactsNull(){if(proxy)return proxy().contactsNull();if(this.get("contactsNot")==null)this.put("contactsNot", "");this.put("contacts", null);return this;};
 		/** not .... */
 		public M contactsNot(){if(proxy)return proxy().contactsNot();this.put("contactsNot", "not");return this;};
 		public M contactsNotNull(){if(proxy)return proxy().contactsNotNull();this.put("contactsNot", "not");this.put("contacts", null);return this;};
 		public M contactsNot(Object contacts){if(proxy)return proxy().contactsNot(contacts);this.put("contactsNot", "not");this.put("contacts", contacts);return this;};
	 		
			
		
			
	 	
			
		
		/** 手机号 [非空]       **/
		public M mobile(Object mobile){if(proxy)return proxy().mobile(mobile);  this.put("mobile", mobile);return this;};
	 	/** and mobile is null */
 		public M mobileNull(){if(proxy)return proxy().mobileNull();if(this.get("mobileNot")==null)this.put("mobileNot", "");this.put("mobile", null);return this;};
 		/** not .... */
 		public M mobileNot(){if(proxy)return proxy().mobileNot();this.put("mobileNot", "not");return this;};
 		public M mobileNotNull(){if(proxy)return proxy().mobileNotNull();this.put("mobileNot", "not");this.put("mobile", null);return this;};
 		public M mobileNot(Object mobile){if(proxy)return proxy().mobileNot(mobile);this.put("mobileNot", "not");this.put("mobile", mobile);return this;};
	 		
			
		
			
	 	
			
		
		/** 申请金额 [非空]       **/
		public M money(Object money){if(proxy)return proxy().money(money);  this.put("money", money);return this;};
	 	/** and money is null */
 		public M moneyNull(){if(proxy)return proxy().moneyNull();if(this.get("moneyNot")==null)this.put("moneyNot", "");this.put("money", null);return this;};
 		/** not .... */
 		public M moneyNot(){if(proxy)return proxy().moneyNot();this.put("moneyNot", "not");return this;};
 		public M moneyNotNull(){if(proxy)return proxy().moneyNotNull();this.put("moneyNot", "not");this.put("money", null);return this;};
 		public M moneyNot(Object money){if(proxy)return proxy().moneyNot(money);this.put("moneyNot", "not");this.put("money", money);return this;};
	 		
		/** and money <= ? */
		public M moneyMin(Object min){if(proxy)return proxy().moneyMin(min);this.put("moneyMin", min);return this;};
		/** and money >= ? */
		public M moneyMax(Object max){if(proxy)return proxy().moneyMax(max);this.put("moneyMax", max);return this;};
			
			
		
			
	 	
			
		
		/** 支付宝名称 [非空]       **/
		public M alipayName(Object alipayName){if(proxy)return proxy().alipayName(alipayName);  this.put("alipayName", alipayName);return this;};
	 	/** and alipay_name is null */
 		public M alipayNameNull(){if(proxy)return proxy().alipayNameNull();if(this.get("alipayNameNot")==null)this.put("alipayNameNot", "");this.put("alipayName", null);return this;};
 		/** not .... */
 		public M alipayNameNot(){if(proxy)return proxy().alipayNameNot();this.put("alipayNameNot", "not");return this;};
 		public M alipayNameNotNull(){if(proxy)return proxy().alipayNameNotNull();this.put("alipayNameNot", "not");this.put("alipayName", null);return this;};
 		public M alipayNameNot(Object alipayName){if(proxy)return proxy().alipayNameNot(alipayName);this.put("alipayNameNot", "not");this.put("alipayName", alipayName);return this;};
	 		
			
		
			
	 	
			
		
		/** 支付宝账号 [非空]       **/
		public M alipayNo(Object alipayNo){if(proxy)return proxy().alipayNo(alipayNo);  this.put("alipayNo", alipayNo);return this;};
	 	/** and alipay_no is null */
 		public M alipayNoNull(){if(proxy)return proxy().alipayNoNull();if(this.get("alipayNoNot")==null)this.put("alipayNoNot", "");this.put("alipayNo", null);return this;};
 		/** not .... */
 		public M alipayNoNot(){if(proxy)return proxy().alipayNoNot();this.put("alipayNoNot", "not");return this;};
 		public M alipayNoNotNull(){if(proxy)return proxy().alipayNoNotNull();this.put("alipayNoNot", "not");this.put("alipayNo", null);return this;};
 		public M alipayNoNot(Object alipayNo){if(proxy)return proxy().alipayNoNot(alipayNo);this.put("alipayNoNot", "not");this.put("alipayNo", alipayNo);return this;};
	 		
			
		
			
	 	
			
		
		/** 打款编号        **/
		public M callNo(Object callNo){if(proxy)return proxy().callNo(callNo);  this.put("callNo", callNo);return this;};
	 	/** and call_no is null */
 		public M callNoNull(){if(proxy)return proxy().callNoNull();if(this.get("callNoNot")==null)this.put("callNoNot", "");this.put("callNo", null);return this;};
 		/** not .... */
 		public M callNoNot(){if(proxy)return proxy().callNoNot();this.put("callNoNot", "not");return this;};
 		public M callNoNotNull(){if(proxy)return proxy().callNoNotNull();this.put("callNoNot", "not");this.put("callNo", null);return this;};
 		public M callNoNot(Object callNo){if(proxy)return proxy().callNoNot(callNo);this.put("callNoNot", "not");this.put("callNo", callNo);return this;};
	 		
			
		
			
	 	
			
		
		/** 打款状态 [非空]   1:审核中 2:已打款 3:拒绝     **/
		public M approvalStatus(Object approvalStatus){if(proxy)return proxy().approvalStatus(approvalStatus);  this.put("approvalStatus", approvalStatus);return this;};
	 	/** and approval_status is null */
 		public M approvalStatusNull(){if(proxy)return proxy().approvalStatusNull();if(this.get("approvalStatusNot")==null)this.put("approvalStatusNot", "");this.put("approvalStatus", null);return this;};
 		/** not .... */
 		public M approvalStatusNot(){if(proxy)return proxy().approvalStatusNot();this.put("approvalStatusNot", "not");return this;};
 		public M approvalStatusNotNull(){if(proxy)return proxy().approvalStatusNotNull();this.put("approvalStatusNot", "not");this.put("approvalStatus", null);return this;};
 		public M approvalStatusNot(Object approvalStatus){if(proxy)return proxy().approvalStatusNot(approvalStatus);this.put("approvalStatusNot", "not");this.put("approvalStatus", approvalStatus);return this;};
	 		
			
		public M approvalStatusIn(String ids){
			if(proxy)return proxy().approvalStatusIn(ids);  this.put("approvalStatusIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 日志        **/
		public M erroLog(Object erroLog){if(proxy)return proxy().erroLog(erroLog);  this.put("erroLog", erroLog);return this;};
	 	/** and erro_log is null */
 		public M erroLogNull(){if(proxy)return proxy().erroLogNull();if(this.get("erroLogNot")==null)this.put("erroLogNot", "");this.put("erroLog", null);return this;};
 		/** not .... */
 		public M erroLogNot(){if(proxy)return proxy().erroLogNot();this.put("erroLogNot", "not");return this;};
 		public M erroLogNotNull(){if(proxy)return proxy().erroLogNotNull();this.put("erroLogNot", "not");this.put("erroLog", null);return this;};
 		public M erroLogNot(Object erroLog){if(proxy)return proxy().erroLogNot(erroLog);this.put("erroLogNot", "not");this.put("erroLog", erroLog);return this;};
	 		
			
		
			
	 	
			
		
		/** 拒绝理由        **/
		public M liyou(Object liyou){if(proxy)return proxy().liyou(liyou);  this.put("liyou", liyou);return this;};
	 	/** and liyou is null */
 		public M liyouNull(){if(proxy)return proxy().liyouNull();if(this.get("liyouNot")==null)this.put("liyouNot", "");this.put("liyou", null);return this;};
 		/** not .... */
 		public M liyouNot(){if(proxy)return proxy().liyouNot();this.put("liyouNot", "not");return this;};
 		public M liyouNotNull(){if(proxy)return proxy().liyouNotNull();this.put("liyouNot", "not");this.put("liyou", null);return this;};
 		public M liyouNot(Object liyou){if(proxy)return proxy().liyouNot(liyou);this.put("liyouNot", "not");this.put("liyou", liyou);return this;};
	 		
			
		
			
	 	
			
		
		/** 修改时间 [非空]       **/
		public M updateTime(Object updateTime){if(proxy)return proxy().updateTime(updateTime);  this.put("updateTime", updateTime);return this;};
	 	/** and update_time is null */
 		public M updateTimeNull(){if(proxy)return proxy().updateTimeNull();if(this.get("updateTimeNot")==null)this.put("updateTimeNot", "");this.put("updateTime", null);return this;};
 		/** not .... */
 		public M updateTimeNot(){if(proxy)return proxy().updateTimeNot();this.put("updateTimeNot", "not");return this;};
 		public M updateTimeNotNull(){if(proxy)return proxy().updateTimeNotNull();this.put("updateTimeNot", "not");this.put("updateTime", null);return this;};
 		public M updateTimeNot(Object updateTime){if(proxy)return proxy().updateTimeNot(updateTime);this.put("updateTimeNot", "not");this.put("updateTime", updateTime);return this;};
	 		
 		/** and update_time >= ? */
 		public M updateTimeStart(Object start){if(proxy)return proxy().updateTimeStart(start);this.put("updateTimeStart", start);return this;};			
 		/** and update_time <= ? */
 		public M updateTimeEnd(Object end){if(proxy)return proxy().updateTimeEnd(end);this.put("updateTimeEnd", end);return this;};
			
			
		
			
	 	
			
		
		/** 添加时间 [非空]       **/
		public M addTime(Object addTime){if(proxy)return proxy().addTime(addTime);  this.put("addTime", addTime);return this;};
	 	/** and add_time is null */
 		public M addTimeNull(){if(proxy)return proxy().addTimeNull();if(this.get("addTimeNot")==null)this.put("addTimeNot", "");this.put("addTime", null);return this;};
 		/** not .... */
 		public M addTimeNot(){if(proxy)return proxy().addTimeNot();this.put("addTimeNot", "not");return this;};
 		public M addTimeNotNull(){if(proxy)return proxy().addTimeNotNull();this.put("addTimeNot", "not");this.put("addTime", null);return this;};
 		public M addTimeNot(Object addTime){if(proxy)return proxy().addTimeNot(addTime);this.put("addTimeNot", "not");this.put("addTime", addTime);return this;};
	 		
 		/** and add_time >= ? */
 		public M addTimeStart(Object start){if(proxy)return proxy().addTimeStart(start);this.put("addTimeStart", start);return this;};			
 		/** and add_time <= ? */
 		public M addTimeEnd(Object end){if(proxy)return proxy().addTimeEnd(end);this.put("addTimeEnd", end);return this;};
			
			
		
			
	 	
			
		
		/** 状态 [非空]   1:正常 0:无效     **/
		public M status(Object status){if(proxy)return proxy().status(status);  this.put("status", status);return this;};
	 	/** and status is null */
 		public M statusNull(){if(proxy)return proxy().statusNull();if(this.get("statusNot")==null)this.put("statusNot", "");this.put("status", null);return this;};
 		/** not .... */
 		public M statusNot(){if(proxy)return proxy().statusNot();this.put("statusNot", "not");return this;};
 		public M statusNotNull(){if(proxy)return proxy().statusNotNull();this.put("statusNot", "not");this.put("status", null);return this;};
 		public M statusNot(Object status){if(proxy)return proxy().statusNot(status);this.put("statusNot", "not");this.put("status", status);return this;};
	 		
			
		public M statusIn(String ids){
			if(proxy)return proxy().statusIn(ids);  this.put("statusIn", ids);return this;
		};	
 			
		
			
	 	
	 	public M add(String key, Object value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	 	public M add(F key, Object value) {if(proxy)return proxy().add(key,value);this.put(key.toString(), value);return this;}
	 	
	 	public M desc(C key) {if(proxy)return proxy().desc(key);this.put("desc", key.column);return this;}
	 	public M asc(C key) {if(proxy)return proxy().asc(key);this.put("asc", key.column);return this;}
	 	public M desc(String sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	 	public M asc(String sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	 	public M definex(String sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	 	
	 	/** 获取所有配送商提现 **/
		public @api List<DistributorCash> list(Integer size){			
			return getDistributorCashList(this,size);
		}
		/** 获取配送商提现分页 **/
		public @api Page<DistributorCash> page(Integer page,Integer size){			
			return getDistributorCashPage(page, size , this);
		}
		/** 根据查询条件取配送商提现 **/
		public @api DistributorCash get(){			
			return getDistributorCash(this);
		}
		/** 获取配送商提现数 **/
		public @api Long count(){			
			return getDistributorCashCount(this);
		}
		/** 获取配送商提现表达式 **/
		public @api <T> T eval(String strEval){			
			return getDistributorCashEval(strEval,this);
		}
		
		/** 获取配送商提现统计 **/
		public @api List<Map> stats(C sumKey,C groupKey,int dateType){			
			return getDistributorCashStats(this,sumKey,groupKey,dateType);
		}
		/** 获取配送商提现统计 **/
		public @api List<Map> stats(C sumKey,C groupKey){			
			return getDistributorCashStats(this,sumKey,groupKey,-1);
		}
		
		/** 根据条件更新 **/
		public @api int update(){			
			M where = null;
			M set = null;
			if(this.type==0){
				if(this.linked==null)throw new RuntimeException("未发set");
				where = this;
				set = this.linked;
			}else{
				if(this.linked==null)throw new RuntimeException("未发where条件");
				set = this;
				where = this.linked;
			}
			return updateDistributorCash(set,where);
		}
		/** 根据条件删除 **/
		public @api void delete(){			
			deleteDistributorCash(this);
		}
	}
	
	public static class Param extends M{
		public Param(int type) {
			super(type);
		}
		public Param(int type, Boolean proxy) {
			super(type, proxy);
		}
	}
	
	/** 对象的字段描述 **/
	public static class F{
		
			
		/** 编号 [非空]       **/
		public final static @type(Long.class)  String id="id";
	 			
			
	 	
			
		/** 配送商 [非空] [Distributor]      **/
		public final static @type(Long.class)  String distributor="distributor";
	 			
			
	 	
			
		/** 配送商名称        **/
		public final static @type(String.class) @like String name="name";
	 			
			
	 	
			
		/** 联系人 [非空]       **/
		public final static @type(String.class)  String contacts="contacts";
	 			
			
	 	
			
		/** 手机号 [非空]       **/
		public final static @type(String.class)  String mobile="mobile";
	 			
			
	 	
			
		/** 申请金额 [非空]       **/
		public final static @type(Double.class)  String money="money";
	 			
		/** and money >= ? */
		public final static @type(Double.class) String moneyMin="moneyMin";
		/** and money <= ? */
		public final static @type(Double.class) String moneyMax="moneyMax";
				
			
	 	
			
		/** 支付宝名称 [非空]       **/
		public final static @type(String.class)  String alipayName="alipayName";
	 			
			
	 	
			
		/** 支付宝账号 [非空]       **/
		public final static @type(String.class)  String alipayNo="alipayNo";
	 			
			
	 	
			
		/** 打款编号        **/
		public final static @type(String.class)  String callNo="callNo";
	 			
			
	 	
			
		/** 打款状态 [非空]   1:审核中 2:已打款 3:拒绝     **/
		public final static @type(Short.class)  String approvalStatus="approvalStatus";
	 			
			
	 	
			
		/** 日志        **/
		public final static @type(String.class)  String erroLog="erroLog";
	 			
			
	 	
			
		/** 拒绝理由        **/
		public final static @type(String.class) @like String liyou="liyou";
	 			
			
	 	
			
		/** 修改时间 [非空]       **/
		public final static @type(Date.class)  String updateTime="updateTime";
	 			
	 	/** and update_time >= ? */
 		public final static @type(Date.class) String updateTimeStart="updateTimeStart";
 		/** and update_time <= ? */
 		public final static @type(Date.class) String updateTimeEnd="updateTimeEnd";
				
			
	 	
			
		/** 添加时间 [非空]       **/
		public final static @type(Date.class)  String addTime="addTime";
	 			
	 	/** and add_time >= ? */
 		public final static @type(Date.class) String addTimeStart="addTimeStart";
 		/** and add_time <= ? */
 		public final static @type(Date.class) String addTimeEnd="addTimeEnd";
				
			
	 	
			
		/** 状态 [非空]   1:正常 0:无效     **/
		public final static @type(Short.class)  String status="status";
	 			
			
	 	
	 	public static String get(String name){
			try {
				Field field = F.class.getField(name);
				if(field!=null)
					return field.get(null).toString();
			} catch (Exception e) {
				//e.printStackTrace();
			}
			return null;
		}
	}
	
	
	
	/** 对象的数据库字段描述 **/
	public static enum C{
		
		id("id"),
		distributor("distributor"),
		name("name"),
		contacts("contacts"),
		mobile("mobile"),
		money("money"),
		alipayName("alipay_name"),
		alipayNo("alipay_no"),
		callNo("call_no"),
		approvalStatus("approval_status"),
		erroLog("erro_log"),
		liyou("liyou"),
		updateTime("update_time"),
		addTime("add_time"),
		status("status"),
		count("count");
		String column;
		C(String column){
			this.column = column;
		}
		public String toString(){
			return this.column;
		}
		public static String get(String name){
			try {
				Field field = C.class.getField(name);
				if(field!=null)
					return field.get(null).toString();
			} catch (Exception e) {
				//e.printStackTrace();
			}
			return null;
		}
	}
	
	
	
	
	/**
	* 获取配送商提现数据
	**/
	public static Object getData(Object param){
		if(param==null)
			return null;
		Object value = null;
		if(param.getClass()==Long.class)
			value = DistributorCash.get((Long)param);
		else if(param instanceof java.util.Map){
			java.util.Map params = (Map) param;
			if(params.get("size")==null)
				value = DistributorCash.getDistributorCash(params);
			else
				value = DistributorCash.getDistributorCashList(params, (Integer) params.get("size"));
		}else if(param.getClass()==Long.class )
			value =  DistributorCash.where().id(param).get();
		else if(!Utils.empty(param.toString()))
			value = DistributorCash.get(Long.valueOf(param.toString()));
		return value;
	}
	
	/**对象转json**/
	public Map toJSON(){
		return toJSON(false);
	}
	public Map toJSON(boolean simple){
		return toJSON(simple,0);
	}
	public Map toJSON(boolean simple,int step){
		Map map = new HashMap();
		map.put("id",this.getId());
	
		Utils.fms(map,simple?"":"id",this.getId(),this.getId$());
		
			
 		
	
		Utils.fms(map,simple?"":"distributor",this.getDistributor(),this.getDistributor$());
		
			
 		
	
		Utils.fms(map,simple?"":"name",this.getName(),this.getName$());
		
			
 		
	
		Utils.fms(map,simple?"":"contacts",this.getContacts(),this.getContacts$());
		
			
 		
	
		Utils.fms(map,simple?"":"mobile",this.getMobile(),this.getMobile$());
		
			
 		
	
		Utils.fms(map,simple?"":"money",this.getMoney(),this.getMoney$());
		
			
 		
	
		Utils.fms(map,simple?"name":"alipayName",this.getAlipayName(),this.getAlipayName$());
		
			
 		
	
		Utils.fms(map,simple?"no":"alipayNo",this.getAlipayNo(),this.getAlipayNo$());
		
			
 		
	
		Utils.fms(map,simple?"no":"callNo",this.getCallNo(),this.getCallNo$());
		
			
 		
	
		Utils.fms(map,simple?"status":"approvalStatus",this.getApprovalStatus(),this.getApprovalStatus$());
		
			
 		
	
		Utils.fms(map,simple?"log":"erroLog",this.getErroLog(),this.getErroLog$());
		
			
 		
	
		Utils.fms(map,simple?"":"liyou",this.getLiyou(),this.getLiyou$());
		
			
 		
	
		Utils.fms(map,simple?"time":"updateTime",this.getUpdateTime(),this.getUpdateTime$());
		
			
 		
	
		Utils.fms(map,simple?"time":"addTime",this.getAddTime(),this.getAddTime$());
		
			
 		
	
		Utils.fms(map,simple?"":"status",this.getStatus(),this.getStatus$());
		
			
 		
	
		if(this.suffix!=null)map.put("suffix", this.suffix);
		
		/************LAZY3Q_DEFINE_TOJSON************/
		/************LAZY3Q_DEFINE_TOJSON************/
		return map;
	}
	/**对象转map**/
	public Map toMap(){
		Map map = new HashMap();
	
		map.put("id",this.getId());
 		
	
		map.put("distributor",this.getDistributor());
 		
	
		map.put("name",this.getName());
 		
	
		map.put("contacts",this.getContacts());
 		
	
		map.put("mobile",this.getMobile());
 		
	
		map.put("money",this.getMoney());
 		
	
		map.put("alipayName",this.getAlipayName());
 		
	
		map.put("alipayNo",this.getAlipayNo());
 		
	
		map.put("callNo",this.getCallNo());
 		
	
		map.put("approvalStatus",this.getApprovalStatus());
 		
	
		map.put("erroLog",this.getErroLog());
 		
	
		map.put("liyou",this.getLiyou());
 		
	
		map.put("updateTime",this.getUpdateTime());
 		
	
		map.put("addTime",this.getAddTime());
 		
	
		map.put("status",this.getStatus());
 		
	
		map.put("suffix", this.suffix);
		
		/************LAZY3Q_DEFINE_TOMAP************/
		/************LAZY3Q_DEFINE_TOMAP************/
		return map;
	}
	/**map转对象**/
	public static DistributorCash fromMap(Map map){
		DistributorCash distributorCash = new DistributorCash();
	
		distributorCash.id = Utils.parseLong(map.get("id"));
 		
	
		distributorCash.distributor = Utils.parseLong(map.get("distributor"));
 		
	
	
		distributorCash.contacts = Utils.parseString(map.get("contacts"));
 		
	
		distributorCash.mobile = Utils.parseString(map.get("mobile"));
 		
	
		distributorCash.money = Utils.parseDouble(map.get("money"));
 		
	
		distributorCash.alipayName = Utils.parseString(map.get("alipayName"));
 		
	
		distributorCash.alipayNo = Utils.parseString(map.get("alipayNo"));
 		
	
		distributorCash.callNo = Utils.parseString(map.get("callNo"));
 		
	
		distributorCash.approvalStatus = Utils.parseShort(map.get("approvalStatus"));
 		
	
		distributorCash.erroLog = Utils.parseString(map.get("erroLog"));
 		
	
		distributorCash.liyou = Utils.parseString(map.get("liyou"));
 		
	
		distributorCash.updateTime = Utils.parseDate(map.get("updateTime"));
 		
	
		distributorCash.addTime = Utils.parseDate(map.get("addTime"));
 		
	
		distributorCash.status = Utils.parseShort(map.get("status"));
 		
	
		return distributorCash;
	}
	
	
	/**字段设置标记队列**/
	private Map<String,Boolean> seted=new HashMap();
	public Boolean getSeted(String key){
		return seted.get(key);
	}
	public void setSeted(String key){
		seted.put(key,true);
	}
	/**同步未set的字段**/
	public void mergeSet(DistributorCash old){
		Field[] fields = this.getClass().getDeclaredFields();
		try {
			for(Field field:fields){
				String key = field.getName();
				if(seted.get(key)==null && field.getAnnotation(column.class)!=null){
					field.setAccessible(true);
					field.set(this, field.get(old));					
				}
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
	
		
	/**自定义变量存储**/
	private Map values=new HashMap();
	public Map getValues(){
		return values;
	}
	public void setValues(String name,Object value){
		values.put(name,value);
	}
	
	/**分表时的表名后缀**/
	private String suffix;
	public String getSuffix() {
		return suffix;
	}
	public void setSuffix(String suffix) {
		this.suffix = suffix;
	}
	
	
	/**获取数据库名称**/
	public static String getDataBaseName(){
		return Utils.config("spring.datasource.distribute_sys.name");
	}
	
	
	public static String getIcon(){
		return "/images/icons/20088256422923477803.png";
	}
	public static String getIconfont(){
		return "icon-shijianjiage";
	}
	public static enum ACT{
		列表,添加,修改,详情,提现审核
	};
	public static String getUrl(ACT act,DistributorCash.M params){
		if(params==null)params=new DistributorCash.M(0);
		params.remove("joins");
		params.remove("definexs");
		params.remove("distinct");
		String strUrl = "/admin/delivery/distributorcash.edit.html?";
		if(params.get("id")!=null){
			strUrl+="&id="+Utils.encode(""+params.get("id"),Utils.UTF8);
		}
		if(act==ACT.列表){
			strUrl = "/admin/delivery/distributorcash.html?1=1";
		
		}else if(act==ACT.添加){
			strUrl+="&edittype=insert";
		
		
		}else if(act==ACT.修改){
			strUrl+="&edittype=update";
		
		}else if(act==ACT.详情){
			strUrl+="&edittype=detail";
		
		}else if(act==ACT.提现审核){
			strUrl+="&edittype=methodok";			
		
		}		
		if(params!=null){
			for(Object key:params.keySet()){
				strUrl+="&"+key+"="+Utils.encode(""+params.get(key),Utils.UTF8)+"";
			}
		}
		return strUrl;
	}
	public String getDetailUrl(){
		return this.getUrl(ACT.详情, where.id(this.getId()));
	}
	
	/**
	* 转跳到当前地址
	**/
	public static Protocol redirect(DistributorCash.ACT act,DistributorCash.M params){
		Protocol protocol = Protocol.create(true,null,"ACT_REDIRECT");
		protocol.set("url",DistributorCash.getUrl(act, params));
		return protocol;
	}
	/**
	* 打开一个新的tab页面
	**/
	public static Protocol href(DistributorCash.ACT act,DistributorCash.M params){
		Protocol protocol = Protocol.create(true,null,"ACT_HREF");
		protocol.set("url",DistributorCash.getUrl(act, params));
		protocol.set("title",act.name());
		return protocol;
	}
	/**
	* 显示一个消息框，并且关闭当前的对话框
	**/
	public static Protocol message(String message){
		Protocol protocol = Protocol.create(true,null,"ACT_MESSAGE");
		protocol.set("message",message);
		return protocol;
	}
	
	
	static com.distribute.framework.dao.IDistributorCashDao getDistributorCashDao(){
		return Utils.getBean("distributorCashDao");
	};
	
}